<!doctype html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>用户注册</title>
    </head>
    <body>
        <h1 class="bold" colspan="2">用户注册</h1>
        <form id="userform" name="userform">
            <p>
                编号：<input name="code" disabled="disabled" value="10010" />
            </p>
            <p>
                姓名：<input name="name" type="text" value="张三" />
            </p>
            <p>
                性别：<input name="sex" type="radio" value="1" checked="checked" /> 男
                <input name="sex" type="radio" value="0" />女
            </p>
            <p>
                爱好：
                <input type="checkbox" checked="checked" />编程
                <input type="checkbox" />读书
                <input type="checkbox" />运动
            </p>
            <p>
                家乡：
                <select name="hometown">
                    <option value="1" selected="selected">北京</option>
                    <option value="2">上海</option>
                    <option value="3">天津</option>
                </select>
            </p>
        </form>
        <script src="js/jquery-1.12.4.js"></script>
        <script>
            $(function() {
                var html = "";
                $("#userform :selected").each(
                    function() {
                        html = $("<div></div>").append($(this).clone()).html();
                        alert(html);
                    });
            });
        </script>
    </body>
</html>